// 成就类型枚举
export enum AchievementType {
  CASE_SOLVED = '案件侦破',
  STREAK = '连续破案',
  ACCURACY = '高准确率',
  TIME = '快速破案',
  SPECIAL = '特殊成就'
}

// 玩家成就值对象（不可变）
export class PlayerAchievementValue {
  constructor(
    public readonly id: string,
    public readonly playerId: string,
    public readonly name: string,
    public readonly description: string,
    public readonly type: AchievementType,
    public readonly iconUrl: string,
    public readonly unlockedDate: string,
    public readonly points: number,
    public readonly isHidden: boolean = false
  ) {}
  
  // 创建新的成就实例（不可变特性）
  withUnlockedDate(date: string): PlayerAchievementValue {
    return new PlayerAchievementValue(
      this.id,
      this.playerId,
      this.name,
      this.description,
      this.type,
      this.iconUrl,
      date,
      this.points,
      this.isHidden
    );
  }
}
